﻿-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
USE [WarehouseManagement]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		AnhDQ
-- Create date: 3/22/2011
-- Description:	This stored procedure use to get all Contact records
-- =============================================
ALTER PROCEDURE [GetCollectionContact]
@IsShowAll bit=0
AS
BEGIN
	SELECT 
			c.ContactID,
			c.FullName,
			c.PartnerID,
			c.MobilePhone,
			c.IsDelete
	FROM 
			[Contact] c 
	WHERE 
			c.IsDelete = 0 or  c.[IsDelete] = @IsShowAll
	
END

GO

/*
USE WarehouseManagement
GO

EXEC [GetCollectionContact] 


SELECT * FROM Contact
SELECT * FROM Partner
INSERT INTO Partner (PartnerCode,CompanyName,OfficePhone,MobilePhone,Address,Fax,Email,Rating,Description,IsSupplier) VALUES ('ABCConC','ABC Company','XXXXXXXXX','XXXXXXXXXX','Hanoi','XXXXXXXX','ABC@gmail.com','1','asuhgjasgagsviu',0)
INSERT INTO Partner (PartnerCode,CompanyName,OfficePhone,MobilePhone,Address,Fax,Email,Rating,Description,IsSupplier) VALUES ('DEFComS','DEF Company','XXXXXXXXX','XXXXXXXXXX','Hanoi','XXXXXXXX','DEF@gmail.com','3','awcgqwergq',1)
INSERT INTO Contact (FullName,MobilePhone,PartnerID) VALUES ('Sir 1','XXXXXXXXXX',1)
INSERT INTO Contact (FullName,MobilePhone,PartnerID) VALUES ('Sir 2','XXXXXXXXXX',1)
INSERT INTO Contact (FullName,MobilePhone,PartnerID) VALUES ('Ms 3','XXXXXXXXXX',2)
*/